﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using Icoders.MarketTracker.Web.Lib.Validation;

namespace Icoders.MarketTracker.Web.Lib.Model
{
   public class OrderModel
    {
       public Guid Id { get; set; }
       public int ClientId { set; get; }
       public string ClientName { set; get; }
       public int POPId { set; get; }
       public string POPName { set; get; }
       public IEnumerable<OrderItemModel> Items { get; set; }
    }

    public class OrderItemModel
    {
        public int Id { set; get; }
        public int ProductId { set; get; }
        [Display(Name = " Product name")]
        public string ProductName { set; get; }
        [Required(ErrorMessage="Quantity is required")]
        [DisplayFormat(DataFormatString = "{0:F0}", ApplyFormatInEditMode = true)]
        public decimal Quantity { set; get; }
        [Display(Name = "Reason")]
        [ReasonRequired("Quantity")]
        public int? ReasonId { set; get; }
        
    }
}
